home
***
CD-ROM
|
disk
|
FTP
|
other
***
search
/
Visual Basic Source Code
/
Visual Basic Source Code.iso
/
vbsource
/
improv3a
/
frmlock.frm
(
.txt
)
< prev
next >
Wrap
Visual Basic Form
|
1999-09-25
|
7KB
|
189 lines
VERSION 5.00
Begin VB.Form frmLock
Appearance = 0 'Flat
BackColor = &H80000005&
BorderStyle = 0 'None
Caption = "Form1"
ClientHeight = 3195
ClientLeft = 150
ClientTop = 150
ClientWidth = 4680
LinkTopic = "Form1"
MaxButton = 0 'False
MinButton = 0 'False
ScaleHeight = 3195
ScaleWidth = 4680
ShowInTaskbar = 0 'False
Begin VB.Timer Timer1
Interval = 500
Left = 3720
Top = 2040
End
Begin VB.ListBox lstAccessDenied
BackColor = &H00C0FFFF&
Height = 255
ItemData = "frmLock.frx":0000
Left = 0
List = "frmLock.frx":0002
TabIndex = 2
Top = 1440
Visible = 0 'False
Width = 4455
End
Begin VB.CommandButton cmdAccess
Appearance = 0 'Flat
BackColor = &H80000009&
Caption = "&OK"
Default = -1 'True
Height = 255
Left = 0
Style = 1 'Graphical
TabIndex = 1
Top = 840
Width = 4455
End
Begin VB.TextBox txtPassword
Height = 285
IMEMode = 3 'DISABLE
Left = 0
PasswordChar = "*"
TabIndex = 0
Top = 480
Width = 4455
End
Begin VB.Label lblYes
Alignment = 2 'Center
BackColor = &H000000FF&
BeginProperty Font
Name = "MITIME"
Size = 15.75
Charset = 0
Weight = 400
Underline = 0 'False
Italic = 0 'False
Strikethrough = 0 'False
EndProperty
ForeColor = &H8000000E&
Height = 1095
Left = 120
TabIndex = 6
Top = 1800
Width = 1335
End
Begin VB.Label lblWrong
Alignment = 2 'Center
BackColor = &H00000000&
Caption = "
WRONG PASSWORD!!!!!"
BeginProperty Font
Name = "MITIME"
Size = 24
Charset = 0
Weight = 400
Underline = 0 'False
Italic = 0 'False
Strikethrough = 0 'False
EndProperty
ForeColor = &H000000FF&
Height = 495
Left = 0
TabIndex = 5
Top = 0
Visible = 0 'False
Width = 4455
End
Begin VB.Label lblAttempts
BackColor = &H00FFFFFF&
Caption = "0"
BeginProperty Font
Name = "MS Sans Serif"
Size = 13.5
Charset = 0
Weight = 400
Underline = 0 'False
Italic = 0 'False
Strikethrough = 0 'False
EndProperty
ForeColor = &H000000FF&
Height = 495
Left = 1800
TabIndex = 4
Top = 2160
Visible = 0 'False
Width = 1335
End
Begin VB.Label lblAttempted
BackColor = &H80000009&
Caption = "Attempted Terminal Unlocks:"
Height = 255
Left = 0
TabIndex = 3
Top = 1200
Visible = 0 'False
Width = 4455
End
Attribute VB_Name = "frmLock"
Attribute VB_GlobalNameSpace = False
Attribute VB_Creatable = False
Attribute VB_PredeclaredId = True
Attribute VB_Exposed = False
Private Sub cmdAccess_Click()
If txtPassword.Text = myPass Then 'Correct Password, so Exit
Dim rtn As Long
rtn = FindWindow("Shell_traywnd", "")
Call SetWindowPos(rtn, 0, 0, 0, 0, 0, SWP_SHOWWINDOW)
Dim ret As Integer
Dim pOld As Boolean
ret = SystemParametersInfo(SPI_SCREENSAVERRUNNING, False, pOld, 0)
Else ' Wrong Password!
lstAccessDenied.Visible = True ' \
lblAttempted.Visible = True ' \ Show all we need to show!
lblAttempts.Visible = True ' /
lblWrong.Visible = True ' /
Me.Refresh ' Show the controls
lstAccessDenied.AddItem "ATTEMPTED TERMINAL UNLOCK AT " & Time & ", " & Date & "" 'Catch the Hackers!
lblAttempts.Caption = lblAttempts.Caption + 1 ' Add to number of attempts
Sleep 2000 ' wait 2 seconds...
lblWrong.Visible = False ' hide the 'Wrong Password' label
txtPassword.Text = ""
End If
End Sub
Private Sub Form_Load()
Dim ret As Integer
Dim pOld As Boolean
ret = SystemParametersInfo(SPI_SCREENSAVERRUNNING, True, pOld, 0) 'Disables [CTRL]+[ALT]+[DEL], [ALT]+[TAB], [START]
Dim rtn As Long
rtn = FindWindow("Shell_traywnd", "") ' The Taskbar
Call SetWindowPos(rtn, 0, 0, 0, 0, 0, SWP_HIDEWINDOW) ' Hides the Taskbar
frmLock.Height = Screen.Height 'Set Height of Form equal to that of screen
frmLock.Width = Screen.Width 'Set Width of Form equal to that of screen
frmLock.Left = 0 'Set X coordinate to zero
frmLock.Top = 0 'Set Y coordinate to zero
txtPassword.Left = (Screen.Width / 2) - (txtPassword.Width / 2) ' Set Password box to Mid-Way Point of Screen
txtPassword.Top = 1000 'This is a good place for it to go
cmdAccess.Left = (Screen.Width / 2) - (txtPassword.Width / 2) ' Set Button at same X coordinate as txtPassword Textbox
cmdAccess.Top = 1500 ' Set below txtPassword Textbox
lblWrong.Left = (Screen.Width / 2) - (txtPassword.Width / 2) ' Set in the Middle
lblAttempted.Left = (Screen.Width / 2) - (txtPassword.Width / 2) ' Set in the Middle
lblWrong.Top = 500
lstAccessDenied.Left = (Screen.Width / 2) - (txtPassword.Width / 2) ' Set Password box to Mid-Way Point of Screen
lblAttempted.Top = 2000 '\
lstAccessDenied.Top = 2250 ' \ Set all the controls in a nice line :)
lblAttempts.Left = lstAccessDenied.Left - 500 ' /
lblAttempts.Top = lstAccessDenied.Top '/
lblYes.Height = Screen.Height
lblYes.Width = 2250
lblYes.Top = 0
For i = 1 To 100
lblYes.Caption = lblYes.Caption & "TERMINAL LOCKED" & vbNewLine
Next i
End Sub
Private Sub Timer1_Timer()
If lblYes.BackColor = vbRed Then
lblYes.BackColor = vbWhite
lblYes.ForeColor = vbRed
lblYes.BackColor = vbRed
lblYes.ForeColor = vbWhite
End If
End Sub